package com.company;

public class Task1 {
    public static void main(String[] args) {
        //todo 请写一段示例代码，演示如何在一个方法中捕获多个异常类型。

        try {
            String[] ary = new String[]{"test1", "test2"};
        } catch (NullPointerException npe) {
            npe.printStackTrace();
        } catch (NumberFormatException nfe) {
            nfe.printStackTrace();
        } catch (ClassCastException cce) {
            cce.printStackTrace();
        } catch (ArrayIndexOutOfBoundsException aie) {
            aie.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
